<%@ include file="/taglibs.jsp"%>
<head>
    <title>
    <c:if test="${not empty param.id}">
    	<fmt:message key="attachFileForm.edit.title"/>
    </c:if>
    <c:if test="${empty param.id}">
    	<fmt:message key="attachFileForm.add.title"/>
    </c:if>
    </title>
    <script type="text/javascript" src="${ctx}/scripts/searchFile_module.js"></script>
</head>

<p><fmt:message key="detailForm.header"/></p>
  
<s:form name="attachFileForm" action="save_attach_file" method="post" validate="true">
<s:hidden name="attachFile.id" value="%{attachFile.id}"/>
<s:hidden name="id" value="%{attachFile.id}"/>
<s:hidden name="attachFile.position" value="%{attachFile.position}"/>

<s:select key="file.field" name="fieldId" list="fields" listKey="id" listValue="name" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"></s:select><br/>
<s:select key="file.category" cssStyle="max-width: 500px !important;" id="cateId" name="cateId" list="catList" listKey="value" listValue="name" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}" required="true"></s:select>   
<s:select key="file.categoryType" list="lstCategoryType"  name="cateTypeId" listKey="id" listValue="name" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}" required="true"/>
<s:select key="documentType.name" list="lstDocumentType"  name="attachFile.documentType.id" listKey="id" listValue="name" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}" required="true"/>
<s:checkbox key="attachFile.heading" />


<s:textarea maxlength="999" required="true" id="attachFileName" key="attachFile.attachFileName" cols="50" rows="7"></s:textarea> 
<s:select key="attachFile.numberOfCopy" 
		list="#{'1':'1', '2':'2', '3':'3', '4':'4', '5':'5', '6':'6', '7':'7', '8':'8', '9':'9'}" 
		name="attachFile.numberOfCopy" value = "attachFile.numberOfCopy" required="true"/>

<tr>
    <td colspan="2">
    	<button type="submit" class="button" name="save" onclick="this.blur()" >
			<fmt:message key="button.save.title"></fmt:message>
			<img src="${ctx}/images/btn_save.png" align="left" height="20" width="20">
		</button>
	    <c:if test="${not empty attachFile.id}">
	    	<button type="submit" class="button" name="delete" onclick="return confirm('<fmt:message key="message.delete.confirm"></fmt:message>')">
				<fmt:message key="button.delete.title"></fmt:message>
				<img src="${ctx}/images/btn_delete.png" align="left" height="20" width="20">
			</button>
    	</c:if>
        <button type="submit" class="button" name="cancel" onclick="form.onsubmit=null"">
			<fmt:message key="button.cancel.title"></fmt:message>
			<img src="${ctx}/images/btn_cancel.png" align="left" height="20" width="20">
		</button>
      <%-- <button type="submit" class="button" name="cancel" onclick="form.onsubmit=null"">
			<fmt:message key="button.move.title"></fmt:message>
			<img src="${ctx}/images/document_go.png" align="left" height="20" width="20">
		</button> --%>
    </td>
</tr>
</s:form>
